$(function () {
    //定义常用easyui对象
    var exchangegift_datagrid = $("#exchangegift_datagrid");

    //end

    //初始化礼品兑换列表 exchangegift_datagrid
    exchangegift_datagrid.datagrid({
        title:"礼品兑换列表",
        url:'/exchangegift/list',
        fitColumns:true,
        fit:true,
        pagination:true,
        rownumbers:true,
        singleSelect:true,
        striped:true,
        toolbar: '#tb',
        columns:[[
            {field:'id',title:'编号',width:100},
            {field:'memberinfoCardnumber',title:'会员卡号',width:100},
            {field:'memberinfoName',title:'会员名称',width:100,align:'right'},
            {field:'giftName',title:'礼品名称',width:100,align:'right'},
            {field:'memberinfoPoints',title:'兑换数量',width:100,align:'right'},
            {field:'giftIntegral',title:'消费积分',width:100,align:'right'},
            {field:'inputuserUsername',title:'操作人员',width:100,align:'right'},
            {field:'exchangedate',title:'兑换日期',width:100,align:'right'}
        ]]
    });
    //end

    //响应集合函数对象
    var cmdObj = {

        //高级查询
        query:function () {
            //获取高级查询输入框的文本
            var kw = $("#keyword").textbox("getValue")
            if(!kw){
                $.messager.alert('温馨提示','请输入关键字');
                return;
            }
            exchangegift_datagrid.datagrid("load",{
                keyword:kw
            })
        }
        //end

    };
    //end


    //调用
    $("a[data-cmd]").click(function(){
        var cmd = $(this).data("cmd");
        cmdObj[cmd]();
    })
    //end
})